<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div id="app">
        <input type="text" v-model="m1">
        <select v-model="opt">
            <option value="+">+</option>
            <option value="-">-</option>
            <option value="*">*</option>
            <option value="/">/</option>
        </select>
        <input type="text" v-model="m2">
        <button @click="fun">=</button>
        <input type="text" v-model="date">
    </div>
    <script>
        new Vue({
            el: "#app",
            data: {
                m1: "",
                m2: "",
                date: "",
                opt: "+"
            },
            methods: {
                fun() {
                    switch (this.opt) {
                        case "+":
                            this.date = parseInt(this.m1) + parseInt(this.m2)
                            break;

                        case "-":
                            this.date = parseInt(this.m1) - parseInt(this.m2)
                            break;

                        case "*":
                            this.date = parseInt(this.m1) * parseInt(this.m2)
                            break;

                        case "/":
                            this.date = parseInt(this.m1) / parseInt(this.m2)
                            break;
                        default:
                            break;
                    }
                }
            },
        })
    </script>
</body>

</html>